<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page isErrorPage="true" %>
<!DOCTYPE html>
<html>
<head>
    <title>系统错误</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f8f9fa;
            color: #212529;
            margin: 0;
            padding: 0;
            line-height: 1.6;
        }
        .error-container {
            max-width: 800px;
            margin: 50px auto;
            padding: 30px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 0 15px rgba(0,0,0,0.1);
        }
        .error-header {
            display: flex;
            align-items: center;
            padding-bottom: 20px;
            border-bottom: 1px solid #e9ecef;
        }
        .error-icon {
            font-size: 50px;
            color: #dc3545;
            margin-right: 20px;
        }
        .error-title {
            margin: 0;
            color: #dc3545;
        }
        .error-details {
            margin-top: 30px;
            border-radius: 5px;
            overflow: hidden;
        }
        .detail-header {
            background: #dc3545;
            color: white;
            padding: 12px 15px;
            font-weight: bold;
        }
        .detail-body {
            background: #f8d7da;
            color: #721c24;
            padding: 20px;
            font-family: 'Consolas', 'Monaco', monospace;
            white-space: pre-wrap;
            max-height: 300px;
            overflow: auto;
        }
        .request-card {
            background: #e2e3e5;
            border-left: 4px solid #6c757d;
            padding: 15px;
            margin: 20px 0;
            border-radius: 0 5px 5px 0;
        }
        .actions {
            margin-top: 30px;
            display: flex;
            gap: 15px;
        }
        .btn {
            padding: 10px 20px;
            border-radius: 4px;
            text-decoration: none;
            transition: all 0.3s;
            display: inline-block;
        }
        .btn-back {
            background: #0d6efd;
            color: white;
            border: 1px solid #0d6efd;
        }
        .btn-home {
            background: #198754;
            color: white;
            border: 1px solid #198754;
        }
        .btn-report {
            background: #6c757d;
            color: white;
            border: 1px solid #6c757d;
        }
        .btn:hover {
            opacity: 0.9;
            transform: translateY(-2px);
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        .footer-note {
            margin-top: 30px;
            font-size: 14px;
            color: #6c757d;
            text-align: center;
            padding-top: 15px;
            border-top: 1px solid #e9ecef;
        }
    </style>
</head>
<body>
<div class="error-container">
    <div class="error-header">
        <div class="error-icon">⚠️</div>
        <div>
            <h1 class="error-title">系统发生错误</h1>
            <p>抱歉，系统在处理您的请求时遇到问题</p>
        </div>
    </div>

    <div class="request-card">
        <strong>请求URL:</strong> ${url}
    </div>

    <div class="error-details">
        <div class="detail-header">错误详情</div>
        <div class="detail-body">${exception}</div>
    </div>

    <div class="actions">
        <a href="javascript:history.go(-1);" class="btn btn-back">返回上一页</a>
        <a href="/user/list" class="btn btn-home">返回首页</a>
        <a href="mailto:support@example.com" class="btn btn-report">报告问题</a>
    </div>

    <div class="footer-note">
        发生时间: ${requestScope['javax.servlet.error.timestamp']}
    </div>
</div>
</body>
</html>